package string;

public class IndexOfDemo {
    public static void main(String[] args) {
        String a="Thinking  in Java  ";
        int index=a.indexOf("in");
        System.out.println(index);
        index=a.indexOf("in",3);
        System.out.println(index);
        index=a.indexOf("cnm");
        System.out.println(index);
        index=a.lastIndexOf("in");
        System.out.println(index);
    }
}
